Using PaperPort™ ScanDirect™ with PiXCL

	PiXCL v4.14 and later support the Visioneer Inc. PaperPort™ scanners, and are PaperPort Ready™ applications. That is, if you have purchased a PaperPort scanner and installed the PaperPort 5.0 and later software, you can scan documents and images and load them into a PiXCL application.
	VYSOR has developed a Link DLL for generic PiXCL Runtime Applications, named PXLpport.g32. This Link provides the necessary control and functionality to allow text and image files to be imported semi-automatically into your PiXCL applications, either using PaperPort or Scan Direct. The Link icon that appears in the PaperPort Link tray and the ScanDirect application taskbar is shown at left.

The following topics are available.

Starting ScanDirect

Installing the PXLpport.g32 “PiXCL Application Link” DLL

Configuring PXLpport.g32 Registry Entries

Code Additions to a PiXCL Application

Some PaperPort Software issues you should know

This Help file is not intended to be an exhaustive treatment of PaperPort and Scan Direct. Please refer to the Help files that come with your Visioneer products for full information.

PaperPort, PaperPort Deluxe, PaperPort Ready, Strobe, ScanDirect and the Visioneer logo are trademarks of Visioneer Inc. All Rights Reserved.


Starting ScanDirect

When PaperPort Deluxe 5.0 or later is installed, an entry is created in the Start taskbar for Scan Direct. When you run this application, ScanDirect searches for all the links in the PaperPort installation directory and creates a marquee window like the Windows taskbar, something like the image shown below. This marquee is movable like the taskbar, and can be moved to any edge of your screen.

Part of the ScanDirect application taskbar.

ScanDirect also installs an icon in the task notification area. You will see that the PaperPort driver also loaded an icon here when Windows booted, something like the right and left icons respectively in the image below.

Typical Notification area


Installing the PXLpport.g32 "PiXCL Application Link" DLL

PaperPort works with a series of DLLs called Links by Visioneer, so that you can scan a document, and then drag and drop it on to a Link, which starts the target application. This application can be a PiXCL runtime of your design.

To use the PiXCL Application Link, you must purchase an upgrade for PaperPort 5.0 from Visioneer called PaperPort Deluxe 5.0 (and later) that provides an additional application called ScanDirect that once set up, allows you to scan a document or photo and pass it directly to a selected PiXCL application. ScanDirect does NOT work with PaperPort 5.0, only PaperPort Deluxe 5.0 and later.

The “PiXCL Application Link” DLL PXLpport.g32 should be copied to the PaperPort installation directory. You will find a number of other Links (all extension .g32) supplied with PaperPort here as well.

No further installation is required. PaperPort and ScanDirect locate this Link file automatically when they start up.


Configuring PXLpport.g32 Registry Entries

To use the “PiXCL Application Link” with a PiXCL Runtime Application, you have to make some additions in the Registry, under the HKEY_LOCAL_MACHINE\SOFTWARE\Visioneer\PersistentData\EasyLinks\Image key, as follows

1. 	In sub-key PiXCLAppLink\exe_name, store the path and name of the PiXCL runtime.

2. 	in sub-key PiXCLAppLink\exe_win_title, store the programmed titlebar string of the  PiXCL runtime

These string values can be written to the Registry using the Windows utility RegEdit, or you could use some PiXCL code in the start of your program(s) to set the values accordingly. The second option would be the preferable one if you plan on running various PiXCL Runtime applications that use ScanDirect with different settings.

These Registry entries are read by ScanDirect and PaperPort when they start.  See the Code Additions to a PiXCL Application topic for more information and some sample code.


Code Additions to a PiXCL Application

The “PiXCL Application Link” can be used with ScanDirect in two ways.

Firstly, when you want to load just one scanned image, and start the PiXCL application as needed.

You can only load one scanned image into the PiXCL application using this method. If you try to scan a second image, the PiXCL application will first have to be terminated, and you will get series of error messageboxes from PaperPort. In this case, the required Registry entries in PiXCLAppLink\exe_name described in the previous topic have to be previously set up.

Secondly, when you need to load a series of scanned images into your PiXCL application, you must first start the PiXCL application.

When ScanDirect tries to load the image, it looks for a window with the application window title stored in the Registry, and if it finds it, sends a message (for Windows programmers, the WM_COPYDATA message) to that window, with the name of the temporary image file just created by the scanner. The PiXCL command GetCopyDataMsg is used in your program to retrieve the image file name and then to, if desired display it, or perhaps save it in another file format.

The PXLpport.g32 Link sends a message to a PiXCL application to start execution at a specifically named script label, PPLinkDataReceived, so your program MUST include a label of this name for the link to work.  If the label PPLinkDataReceived does not exist, the WM_COPYDATA message is ignored. An example is shown below. Note that the message passed to your PiXCL application includes the full path-name of the image scanned, not the image itself. The image name  is an arbitrary name created by PaperPort, and the image itself is stored in the PaperPort temporary directory.  Your PiXCL application must use a LoadBitmap or DrawBitmap command to load the image into the PiXCL image list.

For example, if your PiXCL application is imagdraw.exe, and you want to set up the Registry for this specific application, and restore the old settings on exit, and process an image passed via ScanDirect, your code would look something like

Initialize:

{get the current PaperPort settings from

       the Registry and save them.}

Key$ = "SOFTWARE\Visioneer\PersistentData\EasyLinks\Image\PiXCLAppLink"

RDBOpenKey(@RDB_LOCAL_MACHINE, Key$, Handle)

RDBQueryValue(Handle,"exe_name",OldEXEname$,Res)

RDBQueryValue(Handle,"exe_win_title",OldEXEtitle$,Res)

{ debug messages if required

MessageBox(OK,1,INFORMATION,

OldEXEname$,"Old: exe_name",Res)

MessageBox(OK,1,INFORMATION,

OldEXEtitle$,"Old: exe_win_title",Res) }

{Write this application specific settings to the Registry}

NewName$ = "i:\apps\imagdraw.exe"

NewTitle$ = "PiXCL Image Zapper"

RDBSetValue(Handle,"exe_name",NewName$, STRING, Res)

RDBSetValue(Handle,"exe_win_title",NewTitle$, STRING, Res)

RDBCloseKey(Handle,Res)

{ program initialization continues here}

. . .

Wait_for_Input:

WaitInput()

. . .

PPLinkDataReceived: {handle a message from PXLpport.g32 and ScanDirect}

GetCopyDataMsg(ImageFile$)

{now, load the image into the PiXCL image list}

DrawBitmap(20,20,ImageFile$)

. . .

Goto Wait_for_Input

On_Exit:

RDBOpenKey(@RDB_LOCAL_MACHINE, Key$, Handle)

RDBSetValue(Handle,"exe_name",OldEXEName$, STRING, Res)

RDBSetValue(Handle,"exe_win_title",OldEXETitle$, STRING, Res)

End


Some PaperPort Software issues you should know

We have noticed the following situations can cause initial confusion when using PaperPort and ScanDirect.

1. 	If you disconnect the DC power to the scanner while Windows is running, the PaperPort driver will notice this and set itself to a disabled state. Reconnecting the power will not reset the driver, and you will need to reboot Windows to use the scanner again.

2. 	PaperPort and PaperPort Deluxe is where you change the settings for the operation modes e.g. monochrome, 8-bit grayscale or indexed or 24-bit color. It seems this is possible with ScanDirect Preferences, but with PaperPort Deluxe 5.0, this is not the case.

3. 	If the operation mode is changed, it is necessary to unload and reload the driver. This is easily done from the Taskbar notification area icons. An example is shown below.

	If you Ctrl-Right click the driver icon, a popup menu appears, shown at left. Click the “Unload Scanner Driver” item, and you will note that the icon will change to the unloaded mode indicator. Ctrl-Right click again, and select the “Load Scanner Driver” option.  Loading takes a few seconds, and the scanner will chatter when it is re-initialized. The new operation mode is now properly selected, and both PaperPort and ScanDirect will function correctly.
	If you Right click the driver icon (shown above on the left), and select the Info menu item, a messagebox appears showing the various status mode indicators
1.